function[model] = svd_rank_1_update(model,u,v)
%
% SVD of UBV' + u*v'
% Refer to paper
% Fast Low-Rank Modifications of the Thin Singular Value Decomposition, Matthew Brand, 2006.
r = size(model.U,2);
m = model.U'*u;
p = u - model.U*m;
R_u = sqrt(p'*p);
P = p/R_u;

n = model.V'*v;
q = v - model.V*n;
R_v = sqrt(q'*q);
Q = q/R_v;

% Update
model.U(:,r+1) = P;
model.V(:,r+1) = Q;
model.B(:,r+1) = 0;
model.B(r+1,:) = 0;

L = model.B + [m ; R_u]*[n ; R_v]';

[A S B] = svd(L);

model.U = model.U*A;
model.V = model.V*B;
model.B = S;
